﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Helpers.Dal
{
    /// <summary>
    /// sqlite
    /// Data Source=C:\firefox\MyProfile\cookies.sqlite
    /// AddDbContextPool只能有一个构造函数
    /// </summary>
    public partial class SqliteDal : DbContext
    {
        private string connectionString;
        public SqliteDal(string connectionString)
        {
            this.connectionString = connectionString;
        }
        public SqliteDal(DbContextOptions options) : base(options)
        {
        }
        public SqliteDal(DbContextOptions<SqliteDal> options) : base(options) { }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlite(connectionString);
            base.OnConfiguring(optionsBuilder);
        }
    }
}
